package dangs.dao;

import java.sql.SQLException;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import dangs.vo.MemberVO;

public class MemberDAO {
	private SqlMapClientTemplate client;
	public MemberDAO(SqlMapClientTemplate client){
		this.client = client;
	}
	
	
	public void insertMember(MemberVO mvo) throws SQLException{
		client.insert("insertMember", mvo);
	}
	
	public int updateMember(MemberVO mvo) throws SQLException{
		int count = client.update("updateMember", mvo);
		return count;
	}
	
	public int deleteMember(String memberId) throws SQLException{
		int count = client.delete("deleteMember", memberId);
		return count;
	}
	
	public MemberVO selectMemberById(String memberId) throws SQLException{
		MemberVO mvo = (MemberVO)client.queryForObject("selectMemberById", memberId);
		return mvo;
	}
} 
